package com.example.basicquestions.questions.背包01背包之购物单;

import java.util.Scanner;

/**
 * @author liw
 * @date 2023-03-13
 */
public class Test {
    public static void main(String[] args) {

        // 赋值
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int m = scanner.nextInt();
        Good[] goods = new Good[m];
        for(int i = 0; i<m;i++){
            goods[i] = new Good();
        }

        //800 2 0
        for(int i = 0; i < m; i++){
            int v = scanner.nextInt();
            int p = scanner.nextInt();
            int q = scanner.nextInt();

            goods[i].setV(v);
            goods[i].setP(p);

            if(q == 0){
                goods[i].setMain(true);
            }else{
                if(goods[q].getA1() == -1){
                    goods[q].setA1(i);
                }else{
                    goods[q].setA2(i);
                }
            }
        }

        //业务处理
        int[] dp = new int[N+1];
        for(int i = 1;i<=m;i++){
            for(int j = N;j>=0;j--){
                if(goods[i-1].main){
                    continue;
                }
            }

        }

    }
}

class Good{
    int v;
    int p;
    boolean main = false;
    int a1 = -1;
    int a2 = -1;

    public Good() {
    }

    public int getV() {
        return v;
    }

    public int getP() {
        return p;
    }

    public boolean isMain() {
        return main;
    }

    public int getA1() {
        return a1;
    }

    public int getA2() {
        return a2;
    }

    public void setV(int v) {
        this.v = v;
    }

    public void setP(int p) {
        this.p = p;
    }

    public void setMain(boolean main) {
        this.main = main;
    }

    public void setA1(int a1) {
        this.a1 = a1;
    }

    public void setA2(int a2) {
        this.a2 = a2;
    }
}
